<%--
  Created by IntelliJ IDEA.
  User: zhaocan
  Date: 2018/5/3
  Time: 10:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/pages/common/meta.jsp"%>
<div class="ys-module-wrap kuaijie-box" style="margin-right: 0;">
    <div class="ys-module-title">
        <h2>报警时长</h2>
    </div>
    <div class="ys-module-con">
        <div id="alarmTimeChart" style="width:100%; height: 256px; text-align: center;"></div>
    </div>
    <script type="text/javascript">

        function  initalarmTimeChart() {
            uceAjax(G_CTX_PATH+"/callCenter/agentcall/getAverageRingTime.do", {}, function(result){
                var alarmTimeChart = echarts.init(document.getElementById('alarmTimeChart'));
                var alarmTimeOption = {
                    /* tooltip: {
                     trigger: 'item'
                     },*/
                    series: [
                        {
                            type:'pie',
                            radius: ['50%', '80%'],
                            avoidLabelOverlap: false,
                            label: {
                                normal: {
                                    show: true,
                                    position: 'center',
                                    textStyle: {
                                        fontSize: '20',
                                        fontWeight: 'bold'
                                    }
                                }
                            },
                            data:[
                                {value:result[0].AVG_RINGDUR, name:result[0].AVG_RINGDUR+'秒'}
                            ]
                        }
                    ]
                };
                alarmTimeChart.setOption(alarmTimeOption);
            },"GET");
        }
        //初始化报警时长统计
        initalarmTimeChart();
        function setCanvasWidth(){
            $("#alarmTimeChart").children('div').css({'width':'100%'})
            $("#alarmTimeChart").children('div').children('canvas').css({'width':'100%'})
        }
        setCanvasWidth();
        $(window).resize(function(){
            setCanvasWidth();
        })
    </script>
</div>
